﻿using Avalon.Core.MVC.StateBags;
using System;
using System.Linq;
using System.Linq.Expressions;
using Avalon.Core.Data;

namespace Avalon.Core.MVC.Actions
{
    //public sealed class WhereQueryEntityAction<TViewModel, TModel> where TModel : class, IEntity
    //{
    //    private readonly IContextEntityBag<TViewModel, TModel> mBag;

    //    public WhereQueryEntityAction(IContextEntityBag<TViewModel, TModel> pBag)
    //    {
    //        mBag = pBag;
    //    }

    //    public void Execute(Expression<Func<TModel, bool>> pWhere)
    //    {
    //        try
    //        {
    //            mBag.Models = mBag.Models.Where(pWhere);
    //        }
    //        catch (Exception lEx)
    //        {
    //            mBag.Error = new Exception(string.Format("Where query name: {0}", typeof (TModel).Name), lEx);
    //        }
    //    }
    //}
}